package com.show.mytest;

import java.io.FileReader;
import java.io.FileWriter;

public class Test02_Read_Writer {
    public static void main(String[] args) throws Exception {
        // 创建文件字符输入流
        FileReader reader = new FileReader("F:/whatsnew.txt");
        // 创建文件字符输出流
        FileWriter writer = new FileWriter("F:/配置文件1.txt");
        // 创建一个字节数组
        char[] buf = new char[1024];
        // 创建一个长度对象
        int len =  -1;
        while ((len = reader.read(buf)) != -1){
            writer.write(new String(buf,0,len));
        }
        writer.close();
        reader.close();
    }
}
